OTG is yet another example of how to fool viewers into believing one thing without actually doing anything. The application basically uses offscreen GWorlds and palette animation to simulate totally cool animation. Since the program hopes to provide a better understanding of GWorld and palette usage, only the source file, out.c, has been commented. This file, which contains all the color Quickdraw routines, is actually the meat of the example. The remaining source files are just typical toolbox routine calls for event and menu handling. Note that this application was written to work on 8bit de- vices, but can easily be modified for others. Finally, the About box gives a pretty good overview of the first six available demos, so I highly recommend you check it out. Well that's it, and I hope you enjoy this example.
Please run in 256 colors for full effect.
Building the Code
This project was built and tested on CodeWarrior 2.1 using CarbonLib 1.1a3. Since this is a Carbon app, the "Carbon Support" folder of the CarbonSDK should be in the same folder as the CodeWarrior IDE. If this is not the case, the CarbonLib library will have to be re-added to the project. In addition, the CarbonLib extension needs to be in the extension folder. The CarbonSDK (which contains the library and the extension) can be found on Apple's website: http://developer.apple.com/sdk/
Restrictions
Nearly every sample requires more memory than the 384KB CodeWarrior sets as the default heap size. If for some reason the memory has been reset to the default (either through converting the project or whatever) the memory should be reset to 1000 - 2000KB (depending on the application). This can be achieved by going to the projects settings (Edit Menu->C-PPC Settings... under CodeWarrior 2.1) and selecting the "PPC Target" under the "Target" tab.
Other Code Notes
This sample used to be a "non-Carbon" sample, but has been carbonized for demonstration purposes. The "old" code has been left in (commented out) in order to compare and contrast the Carbon versus non-Carbon APIs.